package com.su.middle.services;

import java.util.ArrayList;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;

import com.su.middle.db.dao.ProposalsDAO;
import com.su.middle.db.entity.Proposals;

/**
 * Session Bean implementation class ProposalServices
 */
@Stateless
@WebService
public class ProposalServices implements ProposalServicesLocal {

    /**
     * Default constructor. 
     */
    public ProposalServices() {
        // TODO Auto-generated constructor stub
    }
    
    @WebMethod
    public int createProposal(Proposals proposal) {
    	ProposalsDAO  dao = new ProposalsDAO();
    	return dao.createProposal(proposal);
    }
    
    @WebMethod
    public ArrayList<Proposals> getStudentProposals(String studentName) {
    	ProposalsDAO dao = new ProposalsDAO();
    	return dao.getStudentProposals(studentName);
    }
    
    @WebMethod
    public void updateProposal(int proposalId, String newStatus) {
    	ProposalsDAO dao = new ProposalsDAO();
    	dao.updateProposal(proposalId, newStatus);
    }
}
